﻿<%@ Page Language="C#" MasterPageFile="~/user.master" AutoEventWireup="true" Inherits="MediaMonitor.Users.Report_News"
    Theme="default" Title="Report - News" CodeBehind="report-news.aspx.cs" %>
      
<asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server">
    
    <div style="text-align: Center; padding-right: 10px; padding-bottom:10px;">
    <br /><br />
  
          <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
          
            <td  align="right">
              <asp:Panel runat="server" ID="PnlProduct"  Visible="false">
             <span style="padding-left:10px;">Product:</span>
            <asp:Button ID="btnDownloadAllProduct" runat="server" Text="Download All" 
                OnClick="btnDownloadAllProduct_Clicked"/>
                 </asp:Panel>
            </td>

            <td align="right" style="width:25%;">
             <asp:Panel runat="server" ID="pnlCategory"  Visible="false" >
            <span style="padding-left:10px;">Category :</span>
           <asp:Button ID="btnDownloadAll" runat="server" Text="Download All" 
                OnClick="btnDownloadAll_Clicked" />
                </asp:Panel>
                </td>

               
          
            </tr>
            </table>
        
        <asp:LinkButton ID="btnExport" runat="server" Text=".. Click Here Download PDF .." OnClick="btnExport_Clicked" Font-Size="20" >
        </asp:LinkButton>
    </div>
    <%-- <telerik:RadAjaxPanel ID="pnlRad" runat="server" RestoreOriginalRenderDelegate="false"> --%>
     
    <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>
        
        <br /><br /> <br />
        <asp:GridView ID="radGrid" runat="server" AllowPaging="True" AutoGenerateColumns="false"
            AllowSorting="false" GridLines="Both"  
            PageSize="20" RowStyle-Font-Size="8" SkinID="Plain"
            >
                 <RowStyle Font-Size="Smaller" />
                <Columns>
                     <asp:BoundField DataField="RFDate" HtmlEncode="false" DataFormatString="{0:d}"
                         HeaderText="Date" ItemStyle-Font-Size="7" />
                    
                    <asp:BoundField DataField="PageNumber" HeaderText="Page Number" 
                        ItemStyle-Font-Size="7" />
                    <asp:BoundField DataField="SectionName" HeaderText="Section" 
                        ItemStyle-Font-Size="7" />
                    <asp:BoundField DataField="ProductName" HeaderText="Product" ItemStyle-Font-Size="7" />
                         
                    <asp:BoundField DataField="MediaName" HeaderText="Media" ItemStyle-Font-Size="7" />
                  
                    <asp:TemplateField HeaderText="Details">
                        <ItemTemplate>
                            <img src="<%=Utility.AppPath%>/images/PDF_Details.jpg" />
                        </ItemTemplate>
                    </asp:TemplateField>
                      
                </Columns> 
            
        </asp:GridView>

            <asp:ObjectDataSource ID="objDS" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportNews" EnablePaging="true" StartRowIndexParameterName="startRowIndex"
                MaximumRowsParameterName="maximumRows" SortParameterName="sortColumn" OnSelecting="ObjDS_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" /> 
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String"  DefaultValue="" ConvertEmptyStringToNull="true" />
                    <asp:Parameter Name="sectorCode" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="subSectorCode" Type="Int32"  
                        DefaultValue="0" />
                    
                    <asp:Parameter Name="categoryCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="advertiserCode" Type="Int32"  
                        DefaultValue="0" /> 
                    <asp:Parameter Name="productCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="sPrice" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="sectionCode" Type="Int32" DefaultValue="0" />
                    <asp:Parameter Name="newsTypeCode" Type="Int32" DefaultValue="0" />
                    <asp:Parameter Name="newsMediaType" Type="String" DefaultValue="" />
                    <asp:Parameter Name="fa" Type="Boolean"  DefaultValue="0" />
                </SelectParameters>
            </asp:ObjectDataSource>

        
         <!--start modal-->
            <script type="text/javascript">


        function SetPostion2(obj, width, height) {

            if (!obj)
                return;

            var left = parseInt((screen.availWidth / 2) - (width / 2));
            var top = parseInt((screen.availHeight / 2) - (height));

            var scrollTop = document.body.scrollTop;
            if (scrollTop == 0) {
                if (window.pageYOffset)
                    scrollTop = window.pageYOffset;
                else
                    scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
            }

            obj.style.left = left + 'px';
            obj.style.top = scrollTop + top + 'px';
            //obj.style.width=width+'px';
            //obj.style.height=height+'px';
            obj.style.position = 'absolute';

        }

        function SetPositionBg2(obj) {
            if (!obj)
                return;

            var left = 0;
            var top = 0;

            var scrollTop = document.body.scrollTop;
            if (scrollTop == 0) {
                if (window.pageYOffset)
                    scrollTop = window.pageYOffset;
                else
                    scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
            }

            obj.style.left = left + 'px';
            obj.style.top = scrollTop + top + 'px';
            //obj.style.width=width+'px';
            obj.style.height = scrollTop + screen.availHeight + 'px';
            obj.style.position = 'absolute';

        }

        function AjaxLoading2(tbl, dv, bool) {
            if (bool) {
                SetPostion2(document.getElementById(tbl), 350, 200);
                SetPositionBg2(document.getElementById(dv));
                document.getElementById(tbl).style.display = 'block';
                //document.getElementById('dvBg').style.display='block';
            }
            else {
                document.getElementById(tbl).style.display = 'none';
                //document.getElementById('dvBg').style.display='none';
            }
        }

  </script>

              
             
             
         </div> 
         <!--end modal-->

        </ContentTemplate>
    </asp:UpdatePanel>

    <%--</telerik:RadAjaxPanel> --%>
   
</asp:Content>

